var _tools = require("../../../utils/tools.js"), _tools2 = _interopRequireDefault(_tools);

function _interopRequireDefault(t) {
    return t && t.__esModule ? t : {
        default: t
    };
}

var that, app = getApp();

Page({
    data: {
        id: 0,
        indicatorDots: !1,
        vertical: !1,
        autoplay: !0,
        interval: 5e3,
        duration: 1e3,
        isScrollY: !0,
        current: 0,
        isIphoneX: !1,
        isIphone: !1,
        audit_model: !0,
        show_login: !0,
        is_auth: !0
    },
    onLoad: function(t) {
        (that = this).data.id = t.id;
    },
    cancel_login: function() {
        that.setData({
            show_login: !1
        });
    },
    showOfficial: function() {
        wx.previewImage({
            current: that.data.config.official_account_img,
            urls: [ that.data.config.official_account_img ]
        });
    },
    onReady: function() {
        var t = {
            action: "index",
            contr: "my",
            token: wx.getStorageSync("token")
        };
        _tools2.default.request(t, function(t) {
            that.setData(t.info);
            var o = null;
            wx.createInterstitialAd && t.info.config.screen_ad && ((o = wx.createInterstitialAd({
                adUnitId: t.info.config.screen_ad
            })).onLoad(function() {
            }), o.onError(function(t) {
            }), o.onClose(function(t) {
            }), o.show().catch(function(t) {
                console.error(t);
            }));
        });
    },
    getUserProfile(e) {
        // 推荐使用wx.getUserProfile获取用户信息，开发者每次通过该接口获取用户个人信息均需用户确认
        // 开发者妥善保管用户快速填写的头像昵称，避免重复弹窗
        wx.getUserProfile({
          desc: '用于完善会员资料', // 声明获取用户个人信息后的用途，后续会展示在弹窗中，请谨慎填写
          success: (res) => {
          }
        })
      },
    getUserInfo: function(t) {
        if ("getUserProfile:ok" == t.detail.errMsg) {
            var o = {
                action: "login",
                contr: "my",
                token: wx.getStorageSync("token"),
                encryptedData: t.encryptedData,
                iv: t.iv
            };
            _tools2.default.request(o, function(t) {
                that.onReady();
            });
        }
    },
    gotoCash: function() {
        wx.navigateTo({
            url: "/bh_cat/pages/cash/cash"
        });
    },
    onUnload: function() {},
    onHide: function() {},
    onShow: function() {},
    onShareAppMessage: function() {
        return {
            title: this.data.share.text,
            imageUrl: this.data.share.images,
            path: "bh_rising/pages/index/index?parent_id=" + this.data.share.member_id
        };
    }
});